<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
	</head>
	<body>

		<input type="file" name="upload" multiple="multiple" />
		<button onclick="uploadFile()" style="width: 120;height: 40;">提交</button>
		<br /><br /><br />
		<textarea id="content"  rows="10" style="width:600px"> </textarea>
		<br /><br />
		<button onclick="getList()" style="width: 120;height: 40;">设置文本框的值</button>

	</body>


	<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.1.1.min.js"></script>
	<script src="js/fetch_request.js"></script>

	<script>

		function getList(){
			F_Request.getRequest('http://localhost:8080/list', null, function(data) {
				document.getElementById("content").innerText = JSON.stringify(data);
				console.log(data);
			}, function(error) {
				console.log(error);
			});
			
		}
		


		//上传请求
		function uploadFile() {
			//upload 是name值  file 是后台接收 参数的值
			F_Request.uploadFileRequest("upload","file", {
				userName: '李四',
				age: 15
			}, 'http://localhost:8080/uploadMul', null, function(data) {
				console.log("上传成功:");
				console.log(data);
			}, function(error) {
				console.log("上传失败");
			});
		}



	</script>
</html>
